Skip to content

fix: status card for request changes and validation for new join steps#1151

Open
MayankBansal12 wants to merge 4 commits intodevelopfrom
refactor/create-application
Open

fix: status card for request changes and validation for new join steps#1151
MayankBansal12 wants to merge 4 commits intodevelopfrom
refactor/create-application

Conversation

@MayankBansal12
Copy link
Member

@MayankBansal12 MayankBansal12 commented Feb 26, 2026

Date: 27-02-26

Developer Name: @MayankBansal12


Issue Ticket Number:-

Description:

Is Under Feature Flag

  • Yes
  • No

Database changes

  • Yes
  • No

Breaking changes (If your feature is breaking/missing something please mention pending tickets)

  • Yes
  • No

Is Development Tested?

  • Yes
  • No

Tested in staging?

  • Yes
  • No

Add relevant Screenshot below ( e.g test coverage etc. )

screencast

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Summary by CodeRabbit

  • New Features

    • Added "Changes Requested" status for applications with admin feedback display and edit functionality
    • Auto-select user role during signup when available in profile
    • Added profile image upload requirement to Step One
  • Improvements

    • Updated sign-up greeting to reference social logins instead of GitHub-specific language
    • Enhanced application submission and redirection flow
    • Optimized form input response timing

Walkthrough

This PR extends the application management flow by introducing a "changes_requested" status for handling application revisions, adding automatic role prefilling during onboarding, refactoring form field validation logic, and updating navigation to redirect to application detail pages instead of the join route.

Changes

Cohort / File(s) Summary
Changes Requested Status
app/components/join-steps/status-card.hbs, app/components/join-steps/status-card.js, app/constants/join.js
Introduces new "changes_requested" status with UI feedback block, description, and "Edit Application" button. New status added to APPLICATION_STATUSES constant and feedback getter extended to handle array-based feedback.
Role Prefilling & Image Validation
app/components/new-join-steps/new-step-one.hbs, app/components/new-join-steps/new-step-one.js, app/constants/new-join-form.js
Automatically prefills user role from profile with disabled state indicator, adds imageUrl field with validation rules, and conditionally renders "(auto-applied from profile)" message.
Form Field Handling Refactor
app/components/new-join-steps/base-step.js
Restructures inputHandler to perform granular per-field updates (validateField, updateWordCount, updateErrorMessage) with debounced syncFormValidity; validateField now returns shaped object results; adds image-specific error message in formatError.
Stepper & Navigation Updates
app/components/new-stepper.js, app/controllers/join.js, app/controllers/goto.js
Refactors submit response parsing with improved error handling; redirects to applications.detail instead of join route; adds tracked edit and dev properties to JoinController; simplifies goto controller redirection logic.
Constants & UI Updates
app/constants/urls.js, app/constants/new-signup.js, app/components/signup-steps/step-zero.*, app/styles/new-stepper.module.css
Updates development URLs to fully-qualified format (dev.realdevsquad.com); changes heading constant from "GitHub" to "socials"; adds role-selection-message CSS styling.
Test Updates
tests/integration/components/new-join-steps/new-step-one-test.js, tests/integration/components/new-signup/info-test.js, tests/integration/components/new-stepper-test.js, tests/integration/components/signup-steps/step-zero-test.js
Adds tests for role prefilling and disabled state; updates test expectations for response parsing and redirect targets; replaces hard-coded strings with imported constants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • AnujChhikara
  • iamitprakash
  • Hariom01010

Poem

🐰✨ A rabbit hops through forms so new,
With roles prefilled and edits due,
Status changed, where feedback flows,
Image fields and endpoints grow,
Application paths refined with care! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is a template with unfilled placeholders and does not provide substantive details about the changes, objectives, or rationale for the pull request. Complete the PR description template with actual values: fill in the issue ticket number, add a meaningful description of changes and their purpose, and specify which checklist items apply.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: status card for request changes and validation for new join steps' clearly reflects the main changes: adding status card for 'changes_requested', implementing validation improvements, and handling role auto-apply behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/create-application

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 26, 2026

Deploying www-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6291200
Status: ✅  Deploy successful!
Preview URL: https://05dcd081.www-rds.pages.dev
Branch Preview URL: https://refactor-create-application.www-rds.pages.dev

View logs

@MayankBansal12 MayankBansal12 marked this pull request as ready for review February 27, 2026 21:10
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/new-join-steps/new-step-one.js`:
- Around line 58-65: The code assumes any existing userRole maps to a key and
sets isRoleAvailable true even when unmapped; change the logic in the block that
uses userRole/USER_ROLE_MAP so you first compute roleKey (from
Object.keys(USER_ROLE_MAP).find(...)) and then only call
this.updateFieldValue('role', roleKey) and set this.isRoleAvailable = true when
roleKey is defined (non-undefined); if roleKey is undefined, do not call
updateFieldValue and ensure this.isRoleAvailable remains false so role buttons
are not disabled. Also keep the checks around this.login.userData?.role
(userRole) as-is.

In `@app/components/new-stepper.js`:
- Around line 171-175: The redirect currently reads applicationId from
data.applicationId and always sets queryParams.dev=true; change it to pull the
id from the nested payload (use data?.application?.id ??
this.onboarding.applicationData?.id) and make queryParams conditional (e.g.
const query = data?.dev ? { dev: true } : {}), then call
this.clearAllStepData(); this.router.transitionTo('applications.detail',
applicationId, { queryParams: query }); update usage around applicationId,
clearAllStepData, and router.transitionTo accordingly.

ℹ️ Review info

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c91d6f and 6291200.

📒 Files selected for processing (19)
  • app/components/join-steps/status-card.hbs
  • app/components/join-steps/status-card.js
  • app/components/new-join-steps/base-step.js
  • app/components/new-join-steps/new-step-one.hbs
  • app/components/new-join-steps/new-step-one.js
  • app/components/new-stepper.js
  • app/components/signup-steps/step-zero.hbs
  • app/components/signup-steps/step-zero.js
  • app/constants/join.js
  • app/constants/new-join-form.js
  • app/constants/new-signup.js
  • app/constants/urls.js
  • app/controllers/goto.js
  • app/controllers/join.js
  • app/styles/new-stepper.module.css
  • tests/integration/components/new-join-steps/new-step-one-test.js
  • tests/integration/components/new-signup/info-test.js
  • tests/integration/components/new-stepper-test.js
  • tests/integration/components/signup-steps/step-zero-test.js

Comment on lines +58 to +65
const userRole = this.login.userData?.role;
if (userRole) {
const roleKey = Object.keys(USER_ROLE_MAP).find(
(key) => USER_ROLE_MAP[key] === userRole,
);
this.updateFieldValue('role', roleKey);
this.isRoleAvailable = true;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Guard unmapped profile roles before disabling role selection.

If userRole exists but has no match in USER_ROLE_MAP, Line 63 writes undefined and Line 64 still sets isRoleAvailable = true. That disables all role buttons without selecting a valid role.

Suggested fix
     const userRole = this.login.userData?.role;
     if (userRole) {
       const roleKey = Object.keys(USER_ROLE_MAP).find(
         (key) => USER_ROLE_MAP[key] === userRole,
       );
-      this.updateFieldValue('role', roleKey);
-      this.isRoleAvailable = true;
+      if (roleKey) {
+        this.updateFieldValue('role', roleKey);
+        this.isRoleAvailable = true;
+      }
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const userRole = this.login.userData?.role;
if (userRole) {
const roleKey = Object.keys(USER_ROLE_MAP).find(
(key) => USER_ROLE_MAP[key] === userRole,
);
this.updateFieldValue('role', roleKey);
this.isRoleAvailable = true;
}
const userRole = this.login.userData?.role;
if (userRole) {
const roleKey = Object.keys(USER_ROLE_MAP).find(
(key) => USER_ROLE_MAP[key] === userRole,
);
if (roleKey) {
this.updateFieldValue('role', roleKey);
this.isRoleAvailable = true;
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/components/new-join-steps/new-step-one.js` around lines 58 - 65, The code
assumes any existing userRole maps to a key and sets isRoleAvailable true even
when unmapped; change the logic in the block that uses userRole/USER_ROLE_MAP so
you first compute roleKey (from Object.keys(USER_ROLE_MAP).find(...)) and then
only call this.updateFieldValue('role', roleKey) and set this.isRoleAvailable =
true when roleKey is defined (non-undefined); if roleKey is undefined, do not
call updateFieldValue and ensure this.isRoleAvailable remains false so role
buttons are not disabled. Also keep the checks around this.login.userData?.role
(userRole) as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant